﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;

namespace NLBS.Control
{
    public class ResourceButton : Button
    {

       public virtual String ResourceName
       {
           get
           {
               Object state = ViewState["ResourceName"];
               if (state != null)
               {
                   return (String)state;
               }
               return "";
           }
           set
           {
               ViewState["ResourceName"] = value;
           }
       }

       protected override void OnPreRender(EventArgs e)
       {
           base.OnPreRender(e);
           this.Text = NLBS.Resources.ResourceManager.GetString(ResourceName);
       }
    }
    public class Resource : System.Web.UI.Control
    {

        public virtual String ResourceName
        {
            get
            {
                Object state = ViewState["ResourceName"];
                if (state != null)
                {
                    return (String)state;
                }
                return "";
            }
            set
            {
                ViewState["ResourceName"] = value;
            }
        }

        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            this.ResourceName = NLBS.Resources.ResourceManager.GetString(ResourceName);
            writer.Write(ResourceName);
            base.Render(writer);
        }
    }
}
